public Class OutTrigger_TestClass
{
     static testMethod  void test()
    {
        Profile pTsr = [select id from profile where  name = 'Sales Rep - Trade' limit 1];
        Profile pASM = [select id from profile where  name = 'Area/District Sales Manager - Medical' limit 1];
        Profile pDSM = [select id from profile where  name = 'Area/District Sales Manager - Medical' limit 1];
        
        List<Profile> pl = [select id from profile where Name='System Administrator' or name = '系统管理员' limit 1];
        
        Profile p=pl[0];
        User u = new User(alias = 'standtss', email='standarduser@testorgss.com',
        emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US',
        Title__c='Area/District Sales Manager',FunctionDepartment__c='Trade Sales',
        localesidkey='en_US', profileid = p.Id,UserCity__c='广州',IsActive=true,
        UserAreaValue__c='广州区域',UserSubRegion__c='华南一区',UserRegion__c='华南区',
        timezonesidkey='America/Los_Angeles', username='standardusers@testorg.com');
        insert u;
        
        User uASM = new User(alias='standtss', email='sdudfdr@testorgss.com',
        emailencodingkey='UTF-8', lastname='Testeing', languagelocalekey='en_US',
        localesidkey='en_US', profileid=pASM.Id,IsActive=true,
        Title__c='Area/District Sales Manager',FunctionDepartment__c='Trade Sales',
        timezonesidkey='America/Los_Angeles', username='stsdfdfrs@testorg.com');
        insert uASM;
        
        User uDSM = new User(alias='standtss',email='sdusdfer@testorgss.com',ManagerId=uASM.Id,emailencodingkey='UTF-8', lastname='Testeing',
        languagelocalekey='en_US',localesidkey='en_US',
        Title__c='Area/District Sales Manager',FunctionDepartment__c='Trade Sales',
        timezonesidkey='America/Los_Angeles',profileid=pDSM.Id,username='stserers@testorg.com');
        insert uDSM;
        
        User uTsr = new User(alias='standtss',email='sduser@testorgss.com',emailencodingkey='UTF-8',ManagerId=uDSM.Id, lastname='Testeing',
        languagelocalekey='en_US',localesidkey='en_US',timezonesidkey='America/Los_Angeles',profileid=pTsr.Id,
        Title__c='Sales Rep',FunctionDepartment__c='Trade Sales',username='stsers@testorg.com');
        insert uTsr;
        
        User uTsr2 = new User(alias='standtss', email='sdusfsdfer@testorgss.com',
        emailencodingkey='UTF-8', lastname='Testeing', languagelocalekey='en_US',
        localesidkey='en_US', profileid=pTsr.Id,IsActive=true,Title__c='Sales Rep',FunctionDepartment__c='Trade Sales'
        ,ManagerId=u.Id,
        timezonesidkey='America/Los_Angeles', username='stssfds@testorg.com');
        insert uTsr2;
        
        System.runAs(uTsr)
        {
            Account acc=new Account();
             acc.Name='test';
             acc.Channel__c='特大型综合超市';
             acc.Outlet_Type__c='全国重点客户';
             acc.Contact__c='aaa';
             acc.No_of_checkout__c=22;
             acc.ContactPhoneNumber__c='1234567456';
             //acc.City__c=citys.Id;
             acc.OwnerId=uTsr.Id;
             insert acc;
            
            //Account a=acc;
            //a.OwnerId=u.Id;
            //update a;
            
        }
        
         System.runAs(u)
        {
           List<Account> aL=[select Name,OwnerId from Account where Name='test' limit 1];
           for(Account a:aL)
           {
                a.OwnerId=uTsr2.Id;
                update a;
           }
        }
       
    }
}